<?php
require_once WEB_ROOT. '/application/library/Bus.php';

class Bus_Rule extends Bus {
    protected $_name = "rules";
    
    protected function _init() {
        
    }
    
    public function getItemsPager($start, $offset){
        return $this->select(array(
            'limit' => "{$start}, {$offset}",
            'order' => "groups_idgroups DESC, actions_idactions ASC"
        ));
    }
    
    public function getItemByIdGroup_IdAction($idgroup, $idaction){
        $result = $this->select(array(
            'fields'=>array(),
            'where' =>"groups_idgroups='{$idgroup}' AND actions_idactions='{$idaction}'"
        ));
        if(count($result)>0){
            return $result[0];
        }
        return false;
    }  
}
?>